package com.chinasi.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.caland.framework.core.page.Pager;
import com.chinasi.dao.ProjectInfoDao;
import com.chinasi.model.BidBasic;
import com.chinasi.model.ProjectInfo;
import com.chinasi.service.ProjectInfoService;

@Service
public class ProjectInfoServiceImpl implements ProjectInfoService {

	/**
	 * ProjectInfoDAO
	 */
	@Autowired
	private ProjectInfoDao projectInfoDao;

	@Override
	public Pager findPageCondition(ProjectInfo searchBean, int currentPage) {
		Pager pager = new Pager(projectInfoDao.getTotalCount(searchBean),currentPage);
		pager.setPageSize(12);
		pager.setData(projectInfoDao.findByCondition(searchBean, pager.getStartRow(), pager.getPageSize()));
		return pager;
	}

	@Override
	public ProjectInfo findById(String id) {
		return projectInfoDao.findByPK(id, ProjectInfo.class);
	}
	
}
